package com.hopu.dy.service.impl;

import com.hopu.dy.mapper.CommentNoticeMapper;
import com.hopu.dy.pojo.CommentNotice;
import com.hopu.dy.service.ICommentNoticeService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

@Service
public class CommentNoticeServiceImpl implements ICommentNoticeService {

    @Resource
    private CommentNoticeMapper commentNoticeMapper;

    @Override
    public void createCommentNotice(CommentNotice notice) {
        notice.setCreateTime(new Date());
        commentNoticeMapper.insert(notice);
    }

    @Override
    public List<CommentNotice> getCommentNotices(Long commentedUserId) {
        return commentNoticeMapper.selectByCommentedUserId(commentedUserId);
    }
}
